<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
	<meta charset="UTF-8">
	<title>绑定银行卡</title>
	<meta name="description" content="">
	<meta name="keywords" content="">
	<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no">
	<meta name="format-detection" content="telephone=no,email=no,adress=no" />
	<meta name="apple-mobile-web-app-capable" content="yes" />  
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<link rel="stylesheet" href="{THEME_PATH}styles/swiper.min.css">
	<link rel="stylesheet" href="{THEME_PATH}styles/reset.css">
	<link rel="stylesheet" href="{THEME_PATH}styles/common.css">
	<link rel="stylesheet" href="{THEME_PATH}styles/style.css">	
	<script src="{THEME_PATH}js/jquery-1.8.3.min.js"></script>
	<script src="{THEME_PATH}js/swiper.min.js"></script>
	<script src="/statics/js/layer/layer.js"></script>
</head>
<body>
	<!-- S header -->
	<header>
		<a href="/index.php?m=user&c=home&a=bank_info" class="headerL iconfont">&#xe69f;</a>
		<h1>绑定银行卡</h1>
	</header>
	<!-- E header -->
	
	<ul class="change_num_box">
		<li class="flex">
			<label class="label">账号</label>
			<div class="flex-1 input_box"><input type="text" placeholder="请输入银行卡号" name="bank_number"></div>
		</li>
		<li class="flex">
			<label class="label">开户行</label>
			<div class="flex-1 input_box"><input type="text" placeholder="请输入开户银行" name="bank_type"></div>
		</li>
	</ul>

	<a href="javascript:;" class="btn">提交</a>
</body>
<script>
$('.btn').click(function(){
	var bank_number = $("input[name='bank_number']").val();
	var bank_type = $("input[name='bank_type']").val();
	// console.log(bank_number);
	// console.log(bank_type);
	if(!bank_number || !bank_type){
		layer.msg('请填写提交的银行卡信息');
	}
	$.ajax({
			url:"/index.php/?m=user&c=home&a=add_bank",
			type:'post',
			data:{bank_number:bank_number,bank_type:bank_type},
			dataType:'json',
			success:function(data){
				if(data.status ==0){
					layer.msg(data.info);
				}else{
					layer.msg(data.info);
					setTimeout(function(){
							location.reload();
						},1000);
					// location.href="/index.php?m=user&c=home&a=bank_info";
					// layer.close(index);
					return;
				}
			}
	});
})
</script>
</html>
